$(function(){
    $(".btn").click(function(){
        var username = $("#inputUsername").val();//取值
        var password = $("#password").val();
        if(!username){
            alert("用户名必填!");
            $("#inputUsername").focus();//获取焦点
            return ;
        }
        if(!password){
            alert("密码必填!");
            $("#password").focus();//获取焦点
            return ;
        }
        //var param = "username="+username+"&password="+password;
        var param = {"username":username,"password":password};
        $.post("login/doLogin",param,function(result){
            if(result.success){
                alert("管理员登录成功!");
                window.location.href="/sss/admin/home";
                //document.write("<h1>Out with the old - in with the new!</h1>");
            }else{
                alert("账号或者密码错误!");
            }
        });
    });
});
